package com.ydche.dao.impl;

import com.ydche.client.SimpleClient;
import com.ydche.dao.ICustomerDao;
import com.ydche.idl_output.CustomerInfo;
import com.ydche.idl_output.CustomerInfoDB;
import com.ydche.util.MyException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CustomerDaoImpl implements ICustomerDao{
    private static Logger log = LogManager.getLogger(CustomerDaoImpl.class);

    @Override
    public int addCustomer(com.ydche.idl_output.CustomerInfoDB info) {
        int infoId = 0;
        try {
            infoId = SimpleClient.getClient().add_customer_info(info);
        } catch (Exception e) {
            MyException.handleThriftException(e);
        }
        return infoId;
    }

    @Override
    public void updateCustomer(com.ydche.idl_output.CustomerInfoDB customerInfo) {

    }

    @Override
    public List<CustomerInfoDB> getCustomerInfo(Long ownerId, String mobile, String identityId, String name) {
        return null;
    }
}
